package net.oschina.app.previousTest;

import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import android.widget.ListView;

import com.robotium.solo.Solo;

import net.oschina.app.AppStart;

/**
 * Created by Administrator on 2017/7/1.
 */

public class ClassTest extends ActivityInstrumentationTestCase2 {

    private Solo solo;

    public ClassTest() {
        super(AppStart.class);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        solo = new Solo(getInstrumentation(), getActivity());
    }

    public void testName() throws Exception {
        solo.sleep(4000);
        //size 代表 集合的个数
        // 打印出来当前  过滤出来 集合的个数
        int count = solo.getCurrentViews(ListView.class).size();
        Log.i("AUTO","ListView count ："+count);
        //获取 ListView 这种控件类型的 当前集合数
        for (ListView view : solo.getCurrentViews(ListView.class)){
            //打印出来 当前ListView   列表项的个数
            Log.i("AUTO",view.getChildCount()+"");
        }
    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
        super.tearDown();
    }
}
